<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <button id="btn">保存1</button>
    <script>
      const btn = document.getElementById("btn");
      function f1() {
        console.log(1);
      }
      function f2() {
        console.log(2);
      }
      function f3() {
        console.log(3);
      }

      btn.addEventListener("click", f1);
      btn.addEventListener("click", f2);
      btn.addEventListener("click", f3);

      // 事件函数队列数组
      const eventArr = [
        {
          name: "click",
          fn: f1,
        },
        {
          name: "click",
          fn: f2,
        },
        {
          name: "click",
          fn: f3,
        },
      ];

      setTimeout(() => {
        btn.removeEventListener("click", f1);
        btn.removeEventListener("click", f2);
        btn.removeEventListener("click", f3);
      }, 5000);
    </script>
  </body>
</html>
